Software system for tracing data

ABSTRACT

In a device containing trace control data which are stored in a data structure in a memory having memory cells and define memory areas including at least one or more adjacent memory cells, a procedure uses the trace control data taken from the data structure to ascertain the memory area and traces the data stored therein. This allows the data to be traced in a manner which is flexibly configurable during operation of the device, without retranslating the procedure.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates, generally, to a software system fortracing data and, more specifically, to such a system wherein theseparation of trace control data from the trace procedure allows thedata to be traced by the trace procedure to be stipulated very flexiblyand without retranslating the trace procedure.

2. Description of the Prior Art

In a contemporary device for processing information, a multiplicity ofinformation processing operations, also called “processes,” are normallyexecuted on the process-handling devices provided in the device; e.g.,processors. In this context, a process is understood to be the operationof information processing taking place in algorithm form; i.e., in aseries of individual information processing steps. Examples of processesare the editing of files or the sending of e-mails. Examples ofinformation processing steps are opening, printing and/or storing a fileor changing a memory area in the main memory.

The information processing steps are performed by a processor under thecontrol of programs having a succession of instructions, also called“machine commands.” In this context, different machine commandscharacterize different fundamental processing steps of the processor.Examples of fundamental processing steps are arithmetic operations;e.g., integer addition or subtraction. The program thus indicates to theprocessor which of its fundamental processing steps needs to be carriedout in which order. To carry out the information processing steps, theprograms use different components of a contemporary informationprocessing device, depending on the type of information processingsteps. These components are also called “operating parts.” Examples ofoperating parts are printers, processors, memory space or files. Toensure that the operating parts have the best possible utilizationlevel, the operating parts are normally used simultaneously; i.e.,reciprocally or jointly. This operating mode of the device is called“multiprogram operation” or “multitasking.” That is, the device appearsto process a number of programs simultaneously. In this context, theprograms can be processed sequentially, i.e., one after the other, or inparallel, i.e., with their timing intermeshed. The intermeshedprocessing of a number of programs is also called “interleaving.”

Since, by way of example, the simultaneous use of the operating partscan give rise to conflicts (for example, when two programs wish tooutput data to the same printer simultaneously or wish to have writeaccess to the same file simultaneously), an operating system is normallyprovided for managing the operating parts. In this context, an operatingsystem includes those programs which, among other things, control andmonitor access to the operating parts, the order of timing forprocessing the programs running in the device, and maintenance of theoperating mode. For the purposes of distinction, these control programsare called “operating system programs” or else “system software,” andthe programs using the system software to access the operating parts arecalled “user programs” or else “application software.”

To support this division of the programs into two classes, contemporaryprocessors normally provide two operating modes, a privileged operatingmode (also called “system mode”), in which all the machine commands canbe executed without limitation of their mode of action, and anunprivileged operating mode (also called “user mode”), in which a fewmachine commands are limited in terms of their mode of action or areprohibited. By way of example, in the unprivileged operating mode, thosemachine commands which are used for direct access to the device'soperating parts are prohibited. Normally, the application software isexecuted in the user mode, and the system software in the system mode.The application software can thus access the operating parts of thedevice only using the system software. The user programs thus contain noprogram parts which, by way of example, stipulate the memory cells of amain memory in which the user programs are stored, how and where thedata of the user programs are stored on background stores, e.g., harddisks, the order in which the user programs are executed or how userprograms and data are protected against unauthorized access. These andother tasks, e.g., management, control or monitoring tasks, areperformed by the operating system. By way of example, the followingfundamental information processing steps are performed by the operatingsystem:

reading in a character from a keyboard;

outputting a character to a screen; and

reading a program into a memory.

For carrying out the fundamental information processing steps, different“operating system procedures” are provided in the operating system. Inthis context, procedures are machine command sequences combined to formunits which can be called. These commands are generally called by theapplication software. In contemporary processors, an operating systemprocedure is normally called using a machine command which the processoruses to interrupt execution of the calling program and to branch it tothe system software. The interruption is also called an “interrupt,” themachine command is also called an “SVC” (Supervisor Call), and thecalled operating system procedure is also called an “SVC procedure.”Once the called procedure has been processed completely, executionnormally branches to the next machine command of the calling program;i.e., to the machine command which immediately succeeds the machinecommand SVC in the machine command sequence of the calling program.

In terms of opportunities for use which have the greatest possibledegree of flexibility, procedures normally contain variable components,also called “formal parameters,” which are usually stipulated by thecalling program when the procedure is called, by indicating “callparameters.” In this context, the formal parameters are replaced by thecall parameters on the basis of specific rules, which are also called“parameter transfer.” When the procedure has been processed, the calledprocedure normally transfers to the calling program “result parameters”which contain an information item determined by the task of theprocedure, e.g., an order confirmation, an error message or a valuecalculated or ascertained by the procedure. In this context, the valueof the calculated result parameters frequently depends on the values ofthe call parameters.

However, procedures having formal parameters are more susceptible toerror than procedures without formal parameters, on account of thegreater degree of flexibility. They therefore need to be tested forfreedom from error with relatively great care when programs are tested.In this context, two potential sources of error are of particularsignificance:

(1) The values of the result parameters of the procedures are generallynot defined for all possible value combinations of the call parameters.It is therefore necessary to test whether the procedures are alwayscalled with permissible value combinations of the call parameters; and

(2) The procedures may have logical coding errors. It is thereforenecessary to test whether the procedures deliver the desired result foreach permissible combination of input values.

Thus, for the program test, i.e., searching for errors in the programs,logging of the call and result parameters of the procedures is ofcentral importance for checking the procedures.

However, since the complexity of contemporary programs means that a fulltest for freedom from error is often not possible, even tested programsfrequently still have errors which can arise during execution of theprograms. In this context, the described central role of the operatingsystem means that errors in the procedures of the operating systemprograms generally have greater consequences than errors in the userprograms; e.g., failure of the device and of all the user programsrunning on it.

The normal method for finding errors is to log the execution of theprocedures of a program using an execution tracking program; also calleda “debugger.” In this context, execution of the program is tracked stepby step under the control of the debugger. In this case, programexecution is stopped by the debugger after each step, for example, anddata stored in the memory cells of the main memory, e.g., the call andresult parameters, can be displayed. However, a program is generallyexecuted without the control of a debugger, since a debugger slows downthe execution time of a program significantly; e.g., by a factor of ten.In addition, errors which arise sporadically, for example, frequently nolonger appear when a program is executed under the control of a debuggeron account of the program being executed more slowly over time. Inaddition, searching for errors using a debugger requires that theerroneous program be terminated and then started together with adebugger, which results in the program being interrupted. This method istherefore unsuitable for finding errors in operating system programs,since the operating system programs normally must not be terminated andrestarted on account of operation of the device usually beinginterrupted in conjunction with this. This is particularly undesirablein devices for connecting telephone calls.

It is therefore necessary to track the execution of a program duringcorrect execution. This is also called “tracing” in the expert field.Normally, special machine commands are inserted into the procedures ofthe programs for this purpose. The machine commands specifically logparticular data, normally the call and result parameters of theprocedures, e.g., in a particular memory area in the main memory, or afile on the background store. The drawback of this, however, is thatother data which may be additionally required for finding an error arenot logged if the special machine commands contain no provision forthese data to be logged. In addition, logging slows down execution ofthe program even when no logging is necessary. This is particularlydisadvantageous in operating system procedures since slowing down theoperating system slows down all the user programs managed by theoperating system, even those which are executed without errors.

The technical background described above is disclosed in Engesser,Hermann [publishers]; Claus, Volker [editors]; Duden “Inforinatik”[Information Technology]; 2nd edition; Mannheim; Leipzig; Vienna;Zurich: Dudenverlag; 1993; ISBN 3-411-05232-5. See, in particular, page8 f (Execution log, Trace), page 83 ff (Operating mode), page 86(Operating means), page 86 ff (Operating system), page 188 (Debugger),page 457 ff (Parallel operation), page 557 ff (Procedure), page 559 ff(Processes), page 720 ff (Testing) and page 756 f (Interruption).

The present invention is thus directed toward developing a method of thetype mentioned in the introduction such that the tracing of data isimproved.

SUMMARY OF THE INVENTION

The present invention can, in essence, be regarded as being that a firstprocedure, also called trace procedure, takes a first information item,also called trace control data, from a data structure stored in thememory of a device, uses the trace control data to ascertain at leastone memory area, and traces at least the data stored in the memory area.A fundamental advantage of the method according to the present inventionarises from the fact that the separation of the trace control data fromthe trace procedure allows for the data to be traced by the traceprocedure to be stipulated very flexibly and without retranslating thetrace procedure. In particular, during tracing, other data additionallycan be logged by extending the trace control data if, by way of example,the error search detects that the other data need to be traced for thepurpose of diagnosing the error. In addition, tracing also can bestopped without interrupting operation, by virtue of the trace controldata stipulating no memory areas to be traced. This is particularlyadvantageous in operating system procedures since, in this case, all theuser programs are executed more quickly when tracing is not carried out.In addition, gradually reducing the extent of the data to be traced orselectively tracing very little data may make it possible, in the caseof sporadically arising errors, to ensure that these errors continue toarise provided that the specific tracing slows down execution of theoperating system procedures over time only minimally.

In accordance with one embodiment of the method according to the presentinvention, the memory area is defined by a statement, contained in thefirst information item, indicating the memory address of the firstmemory cell and the number of memory cells. In accordance with anotherembodiment of the method according to the present invention, the numberof memory cells is defined by indicating the type of data stored in thememory area. Thus, the call and result parameters can be indicated in aparticularly simple manner during the error search, since both thememory address of these parameters and their data type are normallyknown.

In accordance with another embodiment of the method according to thepresent invention, the memory area is defined by a statement, containedin the first information item, indicating the memory addresses of thefirst memory cell and the last memory cell. This advantageously allowsany memory areas to be indicated. This is of particular advantage, forexample, when data having different data types are stored in the memoryarea, and consequently one length statement per data type is notpossible.

In accordance with a further development of the method according to thepresent invention, an operating system which operates the device andcontains at least the trace procedure and a second procedure (alsocalled SVC procedure below) calls the trace procedure instead of the SVCprocedure when the SVC procedure is called. Thus, the trace procedure isadvantageously executed even though the caller has called the SVCprocedure. As such, the calling program need not be altered, whichadvantageously eliminates retranslation of the calling program, which isnormally necessary for this purpose. This is particularly advantageouswhen the calling program cannot be translated; for example, on accountof program source files being unavailable.

In accordance with another embodiment of the method according to thepresent invention, the SVC procedure is called by the trace procedure.As such, the service prompted by the SVC procedure is advantageouslyprovided even when there is a branch to the trace procedure.

In accordance with yet another embodiment of the method according to thepresent invention, at least the data stored in the memory area aretraced on the basis of a second information item, likewise called tracecontrol data below, which is contained in the data structure and definesthe instant of tracing of the memory area, before and/or after thesecond procedure is called. The extent of the data which are to betraced can be controlled as required. Thus, by way of example, the callparameters transferred by the program which actually calls the SVCprocedure are of interest only before the call, and the resultparameters formed by the SVC procedure are of interest only after theSVC procedure is called.

In accordance with one embodiment of the method according to the presentinvention, the device is controlled by the operating system such thatthe data structure can be accessed only by the operating system.Accordingly, the user software can alter the trace control data neitherunintentionally, e.g., as a result of a program error in the usersoftware, nor intentionally, e.g., in order to modify the operatingsystem via a computer virus.

In accordance with another embodiment of the method according to thepresent invention, the trace control data are modified by the operatingsystem on the basis of a control information item. This is advantageousbecause it is frequently only during the error analysis that it becomesobvious which data are to be traced at what time.

In accordance with a further embodiment of the method according to thepresent invention, the operating system makes a setting, on the basis ofa further control information item, such that the trace procedure iscalled instead of the SVC procedure when the SVC procedure is called.This allows selective setting of whether or not the SVC procedure is tobe traced. If tracing is deactivated, the processing speed of theoperating system is increased on account of the fact that tracing doesnot take place.

In accordance with yet another embodiment of the method according to thepresent invention, the modifications made by the operating system aremade during operation of the device. As such, at any instant duringoperation of the device, the error search can be set, flexibly accordingto requirements, to specify which data are traced by which procedure ofthe operating system.

Additional features and advantages of the present invention aredescribed in, and will become apparent from, the following detaileddescription of the preferred embodiments and the drawings.

DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of a contemporary device in which themethod according to the present invention is executed; and

FIG. 2 shows a flowchart for execution of a trace method according tothe present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows, by way of illustration, an information processing device Ewhich contains at least process-handling apparatuses and a memory. Theprocess-handling apparatuses are in the form of a processor CPU and thememory is in the form of a RAM store MEM. The processor CPU and thememory MEM are connected to one another. The memory MEM stores data D inmemory areas SB formed from one or more adjacent memory cells SZ.

The operation of the device E is controlled by an operating system BSstored in the memory MEM. In this context, the operating system BSincludes:

(1) a number of operating system procedures BSP;

(2) an interrupt vector IRV; and

(3) a data structure DS.

The operating system procedures BSP provided are an interrupt handlerIRH, a trace procedure TRC and also a first SVC procedure SVC (1) and asecond SVC procedure SVC (2). The interrupt vector IRV is provided formanaging the operating system procedures BSP internally in the operatingsystem and contains a first procedure reference IR1 to the operatingsystem procedure SVC (1) and a second procedure reference IR2 to thetrace procedure TRC. The data structure DS stores a trace control datavector TSDV and trace control data TSD. In this context, the tracecontrol data vector TSDV is provided for managing the trace control dataTSD internally in the operating system. Storage in the data structure DSadvantageously separates the trace control data TSD from the traceprocedure TRC. To connect the trace control data TSD to the traceprocedure TRC, the trace procedure TRC makes reference to the tracecontrol data vector TSDV managing the trace control data TSD. The tracecontrol data vector TSDV contains a first trace control data referenceTSDP (IR1) and a second trace control data reference TSDP (IR2). Thefirst trace control data reference TSDP (IR1) makes reference to firsttrace control data TSD (1), which in turn make reference to second tracecontrol data TSD (2). The second trace control data reference TSDP (IR2)makes reference to third trace control data TSD (3). The trace controldata TSD are stored in the memory areas SB (TSD). They contain, by wayof example, a respective first information item INF1 and a respectivesecond information item INF2 and also, possibly, a reference to furthertrace control data TSD. The succession of references which proceeds fromthe trace control data reference TSDV (IR1) makes reference to thosetrace control data TSD which stipulate which data D are to be tracedduring the tracing of the operating system procedure SVC (1). In asimilar way, the succession of references which proceeds from the tracecontrol data reference TSDV (IR2) makes reference to those trace controldata TSD which stipulate which data D are to be traced during thetracing of the operating system procedure SVC (2).

The process handling is controlled by the operating system proceduresBSP and/or user programs BP stored in the memory MEM. The user programsBP indicated are a first user program BP (1) and a second user programBP (2). In this context, the operating mode BM of the processor CPU isset to an unprivileged operating mode NPM during execution of the userprocedures BP, and to a privileged operating mode PM during execution ofthe operating system procedures BSP. This precludes access by the userprograms BP to the data structure DS, since the data structure DS isassociated with the operating system BS and can be accessed only in theprivileged operating mode PM. In addition, the memory MEM stores callparameters AP and result parameters EP which the operating system BS andthe user program BP (1) can access.

FIG. 2 shows, by way of illustration, calling of the trace procedureTRC, with the access operations to data D in the memory MEM which takeplace in the process. In this context, four execution sequences areprovided which represent execution of the user programs BP and of threeoperating system procedures BSP—the interrupt handler IRH, the traceprocedure TRC and the SVC procedure SVC. In this context, the operatingsystem procedures BSP represent parts of the operating system BS and areprocessed by the processor CPU in the privileged operating mode PM,while the user programs BP are executed in the unprivileged operatingmode NPM. The data D which are accessed by the programs and are storedin the memory MEM are represented by three dashed lines representing thedata structure DS, the interrupt vector IRV and memory areas SB. Thedashed illustration indicates that the data are used only by theprograms, but themselves contain no program parts executing the methodaccording to the present invention.

For the exemplary embodiment, it is assumed that the user program BP (1)calls the SVC procedure SVC (2). In this context, call parameters AP aretransferred to the operating system BS by storing the call parameters inthe memory area SB (AP). The call is made by the machine commandInterrupt Request IRQ (SVC (2)), which indicates that the SVC procedureSVC (2) is to be executed. As a result of the interrupt request IRQ (SVC(2)), the processor CPU interrupts execution of the user program BP (1)and processes the interrupt handler IRH instead. In this context, theoperating mode of the processor is changed over from an unprivilegedoperating mode NPM to a privileged operating mode PM. The interrupthandler IRH accesses the interrupt vector IRV, which is stored at apermanently prescribed location in the operating system BS. In thiscontext, the operating system BS may be configured, using controlinformation SI (IRV), such that every call for the SVC procedure SVC (2)is traced. For this purpose, the procedure reference IR2 in theinterrupt vector IRV makes reference not to the SVC procedure SVC (2),but rather to the trace procedure TRC. After evaluation of the interruptreference IR2, which is done using evaluation commands EVAL (IRV), theinterrupt handler IRH uses call commands CALL (TRC) to call the traceprocedure TRC instead of the SVC procedure SVC (2) called originally.

When it has been called, the trace procedure TRC accesses the datastructure DS and takes the trace control data TSD (3). The datastructure DS is accessed using evaluation commands EVAL (DS). In thiscontext, the information items INF1 (3) and INF2 (3) are taken from thetrace control data TSD (3). In this case, the trace control data TSD (3)may be configured, using control information SI (DS), such that thefirst information item INF1 (3) contained characterizes the memory areaSB (AP) in which the call parameters AP are stored, and the secondinformation item INF2 (3) stipulates that the tracing of the memory areaSB (AP) is to take place before the SVC procedure SVC (2) is called. Thetrace procedure TRC then traces the call parameters AP stored in thememory area SB (AP) using the trace commands TRACE (1). The traceprocedure TRC then calls the SVC procedure SVC (2) using call commandsCALL (SVC 2)). While the SVC procedure SVC (2) is being processed, theresult parameters EP are stored in the memory area SB (EP). After theend of processing of the SVC procedure SVC (2), processing of the traceprocedure TRC is continued. Since the data structure DS stores nofurther relevant trace control data TSD, there is no further tracing ofdata. Hence, processing within the operating system BS has finished andprocessing of the user program BP (1) is continued. In this context, theoperating mode of the processor CPU is normally changed back over fromthe privileged operating mode PM to the unprivileged operating mode PM.

If, during this tracing of the SVC procedure during operation of thedevice E, it is detected that the result parameters EP likewise need tobe traced, the data structure DS is extended, by inputting controlinformation SI (DS), by further trace control data TSD (4) which containa first information item INF1 (4) and a second information item INF2(4). In this context, the first information item INF1 (4) characterizesthe memory area SB (EP) in which the result parameters EP are stored,and the second information item INF2 (4) stipulates that the tracing ofthe memory area SB (AP) is to take place after the SVC procedure SVC (2)is called. If the result parameters are represented by a value of thedata type INTEGER, for example, the memory area SP (EP) is stipulated byindicating the memory address of the first memory cell SZ in the memoryarea SP (EP) and indicating the data type INTEGER. Alternatively, it maybe stipulated by indicating the first and the last memory cell in amemory area SB. By way of example, the trace control data TSD may needto be traced in order to test the trace procedure. To this end, theentire memory area SB (DS) in which the trace control data TSD arenormally stored is traced. The memory area SB (DS) is stipulated byindicating the first and the last memory cell SZ in the memory cells SZprovided for the memory area SB (DS). Pursuant to this modification,whenever the SVC procedure SVC (2) is called again, the trace procedureTRC traces the result parameters EP using the trace commands TRACE (2)before processing of the calling user program BP is continued.

Finally, it should be noted that the data structure DS is modified, andthis modification is effective immediately, during operation of thedevice E and without interrupting the operating system program BSP orthe user program BP.

Although the present invention has been described with reference tospecific embodiments, those with school in the art will recognize thatchanges may be made in thereto without departing from the spirit andscope of the invention as set forth in the hereafter appended claims.

What is claimed is:
 1. A software system for tracing data, comprising:an interrupt-controlled call interface which includes a modifiableinterrupt vector; at least one system program which is called via theinterrupt-controlled call interface; and at least one trace program fortracing the data; wherein the modifiable interrupt vector includes aprocedure reference, associated with the system program, in a mainmemory which can be modified to contain a reference to one of the systemprogram and the trace program such that, when an interrupt occurs whichrelates to the system program, execution then branches to one of thesystem program and the trace program based on a current value of theprocedure reference.
 2. A software system for tracing data as claimed inclaim 1, further comprising: a control information item, wherein theprocedure reference is formed and modified based on the controlinformation item.
 3. A software system for tracing data as claimed inclaim 1, wherein at least one call for the system program is provided inthe trace program.
 4. A software system for tracing data as claimed inclaim 1, further comprising: trace control data stored separately fromthe trace program, wherein the trace program uses the trace control datato ascertain the data to be traced.
 5. A software system for tracingdata as claimed in claim 4, wherein the trace control data includesfirst information which defines at least one memory area, the memoryarea having at least one adjacent memory cell of a memory and storingthe data to be traced by the trace program.
 6. A software system fortracing data as claimed in claim 5, wherein the trace control dataincludes second information which defines an instant at which the dataare traced.
 7. A software system for tracing data as claimed in claim 6,wherein the instant is situated at least one of before and after thesystem program is called.
 8. A software system for tracing data asclaimed in claim 7, further comprising: a further control informationitem, wherein the trace control data can be modified based on thefurther control information item.
 9. An operating system comprising asoftware system for tracing data, which includes an interrupt-controlledcall interface having a modifiable interrupt vector, at least one systemprogram which is called via the interrupt-controlled call interface, andat least one trace program for tracing the data, wherein the modifiableinterrupt vector includes a procedure reference, associated with thesystem program, in a main memory which can be modified to contain areference to one of the system program and the trace program such that,when an interrupt occurs which relates to the system program, executionthen branches to one of the system program and the trace program basedon a current value of the procedure reference.
 10. An operating systemas claimed in claim 9, wherein the modifications are made duringoperation of the operating system.
 11. A device comprising a softwaresystem for tracing data, comprising an interrupt-controlled callinterface which includes a modifiable interrupt vector, at least onesystem program which is called via the interrupt-controlled callinterface, and at least one trace program for tracing the data, whereinthe modifiable interrupt vector includes a procedure reference,associated with the system program, in a main memory which can bemodified to contain a reference to one of the system program and thetrace program such that, when an interrupt occurs which relates to thesystem program, execution then branches to one of the system program andthe trace program based on a current value of the procedure reference.12. A device is claimed in claim 11, wherein the modifications are madeduring operation of the device.